#ifndef __CAN_MOTOR_USER_H__
#define __CAN_MOTOR_USER_H__

#include "main.h"
#include "Can_Motor_drv.h"

#define can1_fifo0_motor_cnt 5		//can1 fifo0上的电机数量
#define can2_fifo0_motor_cnt 5		//can2 fifo0上的电机数量


/**
 * @brief     电机总角度记录补丁
 */
 //start
typedef struct{
    float init_angle;        //记录电机在初始状态时电调回馈的角度值
    float total_angle;        //记录电机当前位置相对于初始状态所转过的角度值
}motor_angle;


//end


extern Motor_measure_t m_0x201_can1;//电机参数结构体
extern Motor_measure_t m_0x202_can1;
extern Motor_measure_t m_0x203_can1;
extern Motor_measure_t m_0x204_can1;
extern Motor_measure_t m_0x205_can1;

extern Motor_measure_t m_0x201_can2;
extern Motor_measure_t m_0x202_can2;
extern Motor_measure_t m_0x203_can2;
extern Motor_measure_t m_0x204_can2;
extern Motor_measure_t m_0x205_can2;


void can_motor_init(void);
void can_motor_set_speed(Motor_measure_t* pmmt,float speed_rpm);
void can_motor_set_rel_angle(Motor_measure_t* pmmt,float angle);
void can_motor_set_abs_angle(Motor_measure_t* pmmt,float angle);
void can_motor_stop(Motor_measure_t* pmmt);
#endif
